package com.it.bannner.service

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.it.bannner.MainActivity
import com.it.bannner.MainLanActivity
import com.it.bannner.SplashActivity
import com.it.bannner.log.LogWriter


/**
 * 开机启动广播
 */
class BootRestartReceiver : BroadcastReceiver() {
    val ACTION = "android.intent.action.BOOT_COMPLETED"
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent!!.action == ACTION) {
            android.os.Handler().postDelayed({
                LogWriter.e("关机自动重启...:")
                val intent2 = Intent(context, SplashActivity::class.java)
                intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                context!!.startActivity(intent2)

            }, 5000)

        }
    }
}